
from langchain.chains import LLMChain
from langchain_core.prompts import ChatPromptTemplate
from langchain_community.llms import Tongyi


import os
os.environ["DASHSCOPE_API_KEY"] = "secrect key"
llm = Tongyi()
prompt = ChatPromptTemplate.from_template("""
{input} 
"""
    )
chain = LLMChain(llm=llm,prompt=prompt)
print(chain.invoke("帮我写一幅中国春节的对联"))


